#ifndef __baker_HitState_h__
#define __baker_HitState_h__

#include "Prerequire.h"
#include "Vector.h"

namespace baker
{
    /** A structure of hit information
    */
    struct HitInfo
    {
        /** The hit distance on the Ray3 */
        real dist;

        /** The barycentric coordinate of the hit point */
        Vec2 baryCoords;

        /** The vertices of the hit-face */
        Vec3 verts[3];
    };

    class HitStateImpl;

    /** A Hit state object
    */
    class HitState
    {
    public:
        /** Constructor
        */
        HitState();

        /** Destructor
        */
        ~HitState();

        /** Get the number of hits stored in this state
        */
        guint getHitCount() const;

        /** Get the closest-hit index.
        */
        guint getClosestHitIndex() const;

        /** Return the HitInfo at a given index
            @param hitIndex A zero-based hit-index
            @return The reference to the HitInfo at hidIndex
        */
        const HitInfo & getHitInfo( guint hitIndex ) const;

        /** Add a new HitInfo to this state
        */
        HitInfo & appendHitInfo();

    private:
        HitStateImpl * mImpl;

    };
}

#endif  // __baker_HitState_h__
